B Binance · The world's largest crypto exchangeBinance Sign up → AD OKX OKX · A leading global crypto exchangeOKX Sign up → AD
Crypto analysis tools Loading Data: Binance public API

🧪 Crypto Strategy Backtester

Pick a coin, timeframe and period to backtest six rules (MA cross, RSI, Bollinger, MACD, Supertrend, Donchian) on real Binance candles vs buy and hold.

Strategy and costs

Decided on the bar close, filled at the next open
–

Backtest result

Total return–
CAGR–
Max drawdown (MDD)–
Win rate–
Profit factor–
Trades–
Average trade–
Exposure–
Final equity–
–

Price and trades

Closed bars only · ▲ buy ▼ sell (P/L)

Where the rule stands now

–

Trade statistics

Average winner–
Average loser–
Payoff ratio (avg win ÷ avg loss)–
Best trade–
Worst trade–
Longest losing streak–
Average holding time–
Return with zero costs–
Return lost to costs–

Equity curve

Drawdown (% below the running peak)

Trade list

# Entry Entry price Exit Exit price Return Held
–

Click a number to move the price chart to that trade. Fill prices include slippage; returns are after fees on both sides.

Nearby-parameter check (overfitting test)

–

Total return of the same test re-run with nearby parameter values. If only the centre cell looks good and its neighbours do not, the setting probably fits the past by chance. Click a cell to switch to it.

Same strategy on the top coins

Coin
Press the button to apply the current strategy, parameters, period and costs to the top coins by trading volume.

Click a coin to open its full result above.

Reading a backtest honestly

Unfamiliar term? → Crypto & Stock Glossary

For information only, not investment advice. Data comes from exchanges' public APIs and may be delayed or interrupted. Charts: TradingView Lightweight Charts™

What this tool does

What if you had traded this rule in the past? The Crypto Strategy Backtester runs six classic trading rules — moving-average cross (golden and death cross), RSI reversal, Bollinger Band reversal, MACD cross, Supertrend and Donchian breakout — on real historical Binance candles, and puts total return, CAGR, max drawdown, win rate and profit factor side by side with simply holding the coin. Fees and slippage are included, and signals use closed bars only, so no future data leaks in.

How it is calculated

Only closed candles from Binance spot USDT markets are used. Daily tests cover the last 1, 2 or 4 years (365, 731 or 1,461 bars); 1H and 4H tests cover the last 1,000, 2,000 or 3,000 bars. A further 300 bars before the test window are loaded only to warm up the indicators (no trades there). A signal is decided on the close of bar i and filled at the open of bar i+1: buy fill = open × (1 + slippage), sell fill = open × (1 − slippage), and a fee (default 0.1%) is charged on every fill. Default slippage is 0.05% and starting capital 1,000 USDT; every trade uses all capital, long only. 'Crosses above' means A ≤ B on the previous bar and A > B on this bar. (1) MA cross: buy when the fast line (default EMA 20) crosses above the slow line (EMA 60), sell on the cross below. (2) RSI reversal: buy when RSI(14, Wilder smoothing) crosses above 30, sell when it crosses below 70. (3) Bollinger reversal: with bands = 20-bar SMA ± 2 × population standard deviation, buy when the close crosses above the lower band and sell when the close ≥ the middle band (or the upper band if chosen); if both happen on one bar, the sell wins. (4) MACD cross: buy when MACD (EMA 12 − EMA 26) crosses above its signal line (9-period EMA of MACD), optionally only while MACD < 0; sell on the cross below. (5) Supertrend (ATR 10, factor 3): buy on the bar where the direction flips from down to up, sell where it flips from up to down. (6) Donchian breakout: buy when the close > the highest high of the previous 20 bars, sell when the close < the lowest low of the previous 10 bars. Total return = final equity ÷ starting capital − 1 (an open position is marked at the last close); CAGR = (final ÷ start)^(1 ÷ years) − 1, where years = time from the first bar's open to the last bar's close ÷ 365.25 days, hidden for periods under 3 months; MDD = the largest fall of equity from its running peak; win rate = winning trades ÷ closed trades; profit factor = sum of winning trade returns ÷ sum of losing trade returns; payoff ratio = average win ÷ average loss; exposure = bars in a position ÷ all bars. Trade returns are after fees and slippage. Buy & hold buys at the first test bar's open with the same fee and slippage and is marked at the last close.

Reading the screen, section by section

Coin, candle length and test period at the top

The top bar picks the coin (from the top Binance USDT markets by trading value), the candle length (1h, 4h or daily) and the test period. Daily tests cover the last 1, 2 or 4 years (365, 731 or 1,461 bars); 1h and 4h tests cover the last 1,000, 2,000 or 3,000 bars, shown with the rough number of days. The text on the right gives the dates of the first and last bars actually tested and the bar count. For a recently listed coin it adds that only post-listing data exists, so testing starts then. The tool uses closed bars only and discards the forming bar, so the last bar is always one that has already closed. Once a minute it checks whether a new bar has closed and only then re-downloads and recalculates everything. With fewer than 60 closed bars to test, a message replaces the results.

  • Changing the candle length also changes the period options.
  • The address stores coin, candle length, period, strategy, parameters and costs.

Strategy and costs

Choose one of six strategies (MA cross, RSI reversal, Bollinger reversal, MACD cross, Supertrend, Donchian breakout) and only its parameter fields appear. Defaults are EMA 20/60, RSI 14 with 30/70, Bollinger 20 and 2 with a middle-band exit, MACD 12/26/9, Supertrend ATR 10 with factor 3, and Donchian 20/10. The row below sets the fee (default 0.1%), slippage (default 0.05%) and starting capital (default 1,000 USDT). Any change recalculates at once; if a value is out of range or the fast length is not shorter than the slow one, the previous result is dimmed and the reason is shown. The sentence at the bottom spells out the buy and sell rules with your current parameters. 'Reset to defaults' restores the current strategy and costs, and 'Compare all 6 strategies' opens the comparison table below.

  • For Bollinger, if buy and sell conditions coincide on one bar, the sell wins.
  • Every strategy is long-only and trades the whole balance each time.

Result figures and summary

The nine boxes are total return, CAGR, max drawdown (MDD), win rate (wins and losses), profit factor (payoff ratio underneath), number of trades (per year), average trade (best and worst), exposure and final equity (with a KRW estimate); the first three also show the buy-and-hold value for the same period. CAGR is left blank for periods under 3 months and flagged as an annualized sub-year figure under 1 year. A position still open at the end is not counted as a trade but noted as one open position, and equity is marked at the last close. The paragraph below states the return gap against buy and hold in percentage points, compares drawdowns, gives the share of time in a position and the return lost to costs, and warns when fewer than 10 trades have closed that win rate and profit factor are easily swayed by chance.

  • The KRW estimate multiplies by the USDT/KRW price from Bithumb (Upbit if that fails).

Price and trades chart

Over the closed candles of the test period it draws the strategy's lines: two moving averages, three Bollinger lines, Supertrend up and down lines, or the prior N-bar high and low. RSI and MACD strategies open a separate pane below with RSI and its buy and sell levels, or MACD, signal line and histogram. ▲ marks the bar where a buy filled and ▼ where a sell filled (the open of the bar after the signal), and sell marks carry that trade's return. To avoid overlapping text, buy labels appear only with 12 trades or fewer and sell returns only with 60 or fewer. If the last closed bar produced a signal that has not filled yet, that bar gets a circle labelled buy signal or sell signal. A one-bar offset between signal and fill is not a bug; it is the rule itself: decide on the close, fill at the next open.

  • The price, indicator, equity and drawdown charts share one time axis.

Where the rule stands now and trade statistics

'Where the rule stands now' tells you the rule's current state. In a position, it shows the entry date, fill price and the unrealized return at the last close; in cash, when the last trade ended and with what return. It then says whether the last closed bar produced a new buy or sell signal and, if so, that the rule would fill it at the next bar's open, with the next bar's close time beside the title. After that time passes, it recalculates within a minute and the state may change. The trade statistics on the right are average winner and loser, payoff ratio, best and worst trade, longest losing streak (consecutive trades at or below zero), average holding time (days for daily, bars otherwise), return with zero costs, and return lost to costs in percentage points. A signal only means the rule says so; it is not a recommendation to trade.

  • Trade returns are after both fees and slippage.

Equity curve, drawdown chart and trade list

The equity curve plots, bar by bar, the strategy's equity from the starting capital and the equity of putting the same money in at the first bar's open and holding (buy and hold), with each total return in the legend. For long periods or big swings, the log scale makes early stretches comparable as percentages. The drawdown chart below shows, for both lines, how far equity sits below its running peak. Flat stretches in the strategy curve are periods spent waiting in cash. The trade list puts the newest trade first, and any open position sits on top marked as open with its mark at the last close. It lists entry and exit times, fill prices including slippage, return and holding time; click a number to move the price chart to that trade.

  • The deepest point of the drawdown chart is the MDD in the results.

Nearby-parameter check (overfitting test)

This table re-runs the same period with the strategy's two key parameters shifted to nearby values, up to a 5×5 grid, and shows total return. Length-type values are scaled by 0.5, 0.75, 1, 1.5 and 2, RSI levels shifted by ±5 and ±10, and multipliers by ±0.5 and ±1; combinations outside the input range or breaking a rule (fast ≥ slow, for example) are left blank. Shading scales with the size of the return, and the current setting is outlined. Next to the title you see how many combinations are positive and how many beat buy and hold. If only the centre cell looks good and its neighbours do not, the setting probably fitted the past by chance; if a wide area is similar, the rule is less sensitive to its parameters. Click a cell to switch to it.

  • Costs and period stay as currently set.

All six strategies compared and top-coin run

'Compare all 6 strategies' runs each strategy with its defaults on the same coin, period and costs, sorts them by total return and adds a buy-and-hold row at the bottom. Columns are total return, CAGR, MDD, CAGR ÷ MDD (annual return per unit of drawdown), win rate, profit factor, trades (+1 if a position is open) and exposure; click a name to switch to it. Below, 'Same strategy on the top coins' runs only when you press its button: it applies the current strategy, parameters, period and costs to the top coins by trading value (up to 20), filling strategy and buy-and-hold returns, their difference, strategy MDD, win rate and trades as results arrive, sortable by header. Changing a setting clears the table and asks you to run it again. If a rule shines on one coin but trails buy and hold on most, that result may be one coin's luck.

  • Coins without enough data are marked as such.
  • When finished, it shows how many coins beat buy and hold and the median of both returns.

How to use it

Start by choosing the coin, candle length and period, and enter your exchange's real fee and a generous slippage. Pick a strategy, read total return and max drawdown next to the buy-and-hold values, and check that there are enough trades. Use the price chart and trade list to see where it made and lost money, then the equity and drawdown charts to judge whether the ride was bearable. Next, use the nearby-parameter check to see whether it is overly sensitive to its settings, and the six-strategy comparison and top-coin run to see whether the result comes from just one strategy or one coin. This is a calculator that replays the past on closed bars, not a screen to keep open; when a new bar closes it recalculates within a minute. Good companions are a dollar-cost averaging calculator, a multi-coin indicator scanner and a live coin chart.

  • The better a result looks, the more you should re-run it with higher costs.
  • Copy the address to reopen the same setup later.

Things to know

Frequently asked questions

Does it secretly use future data?

No. Signals are computed from closed bars up to the signal bar's close, and fills happen at the next bar's open; the still-forming bar is never used. Real fills can be worse than the open in thin order books or fast moves, so a generous slippage setting is closer to reality.

My TradingView strategy tester gives different results.

Start date, fill method (next bar's open here), fees and slippage, position sizing (all capital, compounded) and the profit factor definition (sum of trade returns here) all change the numbers. The indicators themselves follow TradingView's definitions, including how EMA, RSI and ATR are seeded, so with matching settings the signals land on the same bars in almost all cases.

Can it short or use leverage?

No. It is long-only spot. On a sell signal it sells everything and waits in cash for the next buy signal. Futures, leverage and scaling in are not modelled.

What fee and slippage should I use?

Enter the real fee for your exchange and tier; Binance spot's base fee is 0.1%. Slippage of around 0.05% suits large coins; use more for thinly traded coins or short timeframes. 'Return lost to costs' in the trade statistics shows the impact at a glance.

When does the result update, and how is the KRW amount calculated?

Every minute the page checks whether a new bar has closed; when one has, it reloads the data and recalculates everything. The KRW figure for final equity is the USDT amount times Bithumb's USDT/KRW rate (Upbit if Bithumb fails), a reference only; it can differ from Korean exchange prices, which include the kimchi premium.

For information only, not investment advice. Data comes from exchanges' public APIs and may be delayed or interrupted.

📚 Worth reading
📊Chart Analysis, Properly From the Start→ 📓How to keep a trading journal: reasons apart from results→ 🧾Crypto Trading Fees, Including the Costs Not in the Fee Table→ 📍How to Read Parabolic SAR: Accelerating Dots and Reversals→
← All crypto tools